<layout name="layout" />
<link href="__PUBLIC__/umeditor1_2_2-utf8-php/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
    <script type="text/javascript" src="__PUBLIC__/umeditor1_2_2-utf8-php/third-party/jquery.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/umeditor1_2_2-utf8-php/umeditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/umeditor1_2_2-utf8-php/umeditor.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/umeditor1_2_2-utf8-php/lang/zh-cn/zh-cn.js"></script>
	<script type="text/javascript">
		function addNewExtCat(btn){
			var newSel = $(btn).next("select").clone();
			$(btn).parent().append(newSel);
		}  
	</script> 
<div class="main-div">
    <form method="post" action="{:U('add')}"enctype="multipart/form-data" >
        <table cellspacing="1" cellpadding="3" width="100%">
            <tr>
                <td class="label">主分类</td>
                <td>
                	<select name="cat_id">
                		<option value="0">请选择分类</option>
                		<foreach name="catData" item="v">
                			<option value="{$v.id}"><php>echo str_repeat('-',$v['level']*8);</php>{$v.cat_name}</option>
                		</foreach>
                	</select>
                    <span class="require-field">*</span>
                </td>
            </tr>
            <tr>
                <td class="label">扩展分类</td>
                <td>
                	<input onclick="addNewExtCat(this);" type="button" value="添加一个扩展分类" />
                	<select name="ext_cat_id[]">
                		<option value="0">请选择分类</option>
                		<foreach name="catData" item="v">
                			<option value="{$v.id}"><php>echo str_repeat('-',$v['level']*8);</php>{$v.cat_name}</option>
                		</foreach>
                	</select>
                </td>
            </tr>
            <tr>
                <td class="label">商品名称</td>
                <td>
                    <input type="text" name="goods_name" size="60" maxlength="60" value="" />
                    <span class="require-field">*</span>
                </td>
            </tr>
            <tr>
                <td class="label">市场价格</td>
                <td>
                    <input type="text" name="market_price" />
                    <span class="require-field">*</span>
                </td>
            </tr>
            <tr>
                <td class="label">本店价格</td>
                <td>
                    <input type="text" name="shop_price" />
                    <span class="require-field">*</span>
                </td>
            </tr>
            <tr>
                <td class="label">商品LOGO</td>
                <td>
                    <input type="file" name="logo"/>
                </td>
            </tr>
            <tr>
                <td class="label">商品描述</td>
                <td>
                    <textarea id="goods_desc"  name="goods_desc" cols="60" rows="4"  ></textarea>
                </td>
            </tr>
            <tr>
                <td class="label">是否显示</td>
                <td>
                    <input type="radio" name="is_on_sale" value="是" checked="checked" /> 是
                    <input type="radio" name="is_on_sale" value="否"  /> 否
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center"><br />
                    <input type="submit" class="button" value=" 确定 " />
                    <input type="reset" class="button" value=" 重置 " />
                </td>
            </tr>
        </table>
    </form>
</div>

<script>
UM.getEditor('goods_desc',{
	initialFrameWidth:800		
});

</script>